<template>
  <div class="lend_des">
    {{ getName(status, item) }}
  </div>
</template>
<script setup>
import { useStore } from "vuex";
import { useI18n } from "vue-i18n";
const { locale, t } = useI18n();
const store = useStore();
const props = defineProps({
  status: {
    type: String,
    default: "",
  },
  item: {
    type: Object,
    default: () => {
      return {};
    },
  },
});
const getName = (status, item) => {
  if (status == 0) {
    // 四种提示
    if (item.orderType == 1) {
      // 借入的
      if (item.borrower == store.state.address) {
        return t('thisOrder1')
      } else {
        return t('thisOrder2')
      }
    } else {
      if (item.lender == store.state.address) {
        return t('thisOrder1')
      } else {
        return t('thisOrder3')
      }
    }
  } else if (status == 1) {
    return t('orderStatus1')
  } else if (status == 2) {
    if(item.lender==store.state.address){
      return t('orderStatus2')
    }else if(item.borrower==store.state.address){
      return t('orderStatus22')
    }else{
      return t('orderStatus222')
    }
  } else if (status == 3) {
    return t('orderStatus3')
  } else if (status == 4) {
    return t('orderStatus4')
  } else if (status == 5) {
    return t('orderStatus5')
  }else if (status == 6) {
    return t('orderStatus6')
  }
};
// 改变法币查询
</script>
<style lang="scss" scoped>
.status_tab {
  color: rgb(246, 109, 26);
}
</style>
